﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuloAdministracion.aspx.cs"
    Inherits="SAW.ModuloAdministracion" %>

<script src="Scripts/ModuloAdministracion.js?ver=20110525" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        var options = {
            target: '#DivAdministracion', //, target element(s) to be updated with server response 
            beforeSubmit: showRequestAdmin,  // pre-submit callback 
            success: showAlertaAdmin,  // post-submit callback 
            error: ShowErrorAdmin
            // other available options: 
            //url:       url         // override for form's 'action' attribute 
            //type:      type        // 'get' or 'post', override for form's 'method' attribute 
            //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
            //clearForm: true        // clear all form fields after successful submit 
            //resetForm: true        // reset the form after successful submit 

            // $.ajax options can be used here too, for example: 
            //timeout:   3000 
        };
        $('#FormAdministracion').validate({
            invalidHandler: AlertaDatosObligatorios
        });


        $('#FormAdministracion').ajaxForm(options);
        checkBotonesActivos('BotonesAdministracion');

    });
</script>
<form id="FormAdministracion" runat="server">
<asp:panel runat="server" id="panelAdminUsuarios" visible="False">
     <div id="DivGridUsuarios">
                <script>
                    $(document).ready(function () {
                        InitUsuariosGrid();

                    });
                </script>
                <table id="GridTableUsuarios style="display: none">
                </table>
            </div>
    
    </asp:panel>
<asp:panel runat="server" id="panelAltaUsuario" Visible="False" >
<script>
    $(document).ready(function () {
        $('#esVendedor').css('width', '20px');
     });
</script>
    <div class="PanelesInput">
        <fieldset class="fieldSetDatos">
            <legend>Datos Generales del Cliente</legend>
            <span>Nombre de Usuario:<br />
                <asp:TextBox ID='UserName' runat='server' CssClass="required"></asp:TextBox>
            </span>
            <span>Password:<br />
                <asp:TextBox ID='Password' runat='server' CssClass="required"></asp:TextBox>
            </span>
            <span>Email:<br />
                <asp:TextBox ID='Email' runat='server' CssClass="required"></asp:TextBox>
            </span>
            <span>Nombre:<br />
                <asp:TextBox ID='Nombre' runat='server' CssClass="required"></asp:TextBox>
            </span>
            <span>Apellidos:<br />
                <asp:TextBox ID='Apellidos' runat='server' CssClass="required"></asp:TextBox>
            </span>
            
            <span>
            <br />
            <asp:CheckBox ID="esVendedor" runat="server" Text="es Vendedor" />
            </span>
            
        </fieldset>
    </div>
</asp:panel>
<asp:panel runat="server" id="panelAdminCategorias" >
    <script>
        $(document).ready(function () {
            InitCategoriasGrid();

        });
                </script>
     <div id="DivGridCategorias">
         <div style="float:left; width:250px;">
            <table id="GridCategoriasClientes" style="display: none">
                </table>
         </div>
         <div style="float:left; width:250px;">
            <table id="GridCategoriasProductos" style="display: none">
                </table>
         </div>
         <div style="float:left; width:250px;">
            <table id="GridLineas" style="display: none">
                </table>
         </div>
         <div style="float:left; width:250px;">
            <table id="GridMarcas" style="display: none">
                </table>
         </div>
     </div>
     </asp:panel>
<div style="display: none;">
    <input type="button" name="BotonRespaldoDB" id="BotonRespaldoDB" rel="BotonesAdministracion"
        onclick="DescargarDB();" value="respaldar DB" />
    <asp:button id="botonGuardarUsuario" runat="server" text="Guardar Usuario" rel="BotonesAdministracion"
        onclick="botonGuardarUsuario_Click" Enabled="False"/>
    <asp:button id="botonBorrarUsuario" runat="server" text="Borrar Usuario" rel="BotonesAdministracion"
        onclick="botonBorrarUsuario_Click" Enabled="False"/>

        <asp:HiddenField ID="idUsuarioActual" runat="server" Value="0" />
</div>
</form>
